from apscheduler.schedulers.background import BackgroundScheduler
from datetime import datetime
import time
import threading
def job():
    print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    print('id:',threading.get_ident())


def start_clean():
    sched = BackgroundScheduler()
    sched.add_job(job, 'interval', seconds=1)
    sched.start()

def main_proc():
    print('in main proc')
    time.sleep(5)

def main():
    start_clean()
    main_proc()

if __name__ == '__main__':
    main()